package edu.java.lectures.lec06.abstrclasses;

public class FiguresTest {

    public static void main(String[] args) {
	// --- test 01 ---------------------------------------------------------
	// Triangle tr = new Triangle(3, 4, 5);
	// Square sq = new Square(4);
	//
	// System.out.println("tr.perimeter: " + tr.calculatePerimeter());
	// System.out.println("sq.perimeter: " + sq.calculatePerimeter());

	// --- test 02 ---------------------------------------------------------
	// Figure fig; // ALLOWED
	// // fig = new Figure(5); // TRY IN THE OTHER LIFE, i.e IMPOSSIBLE
	//
	// Figure2 fig2;
	// // fig2 = new Figure2(); // KEEP DREAMING, i.e.e IMPOSSIBLE

	// // --- test 03 ------------------------------------------------------
	// instantiation of abstract class:
	Figure trFig = new Triangle(3, 4, 5);
	Figure sqFig = new Square(5);

	System.out.println(trFig.calculatePerimeter());
	System.out.println(sqFig.calculatePerimeter());

	// Triangle figTr = (Triangle) sqFig; // class cast exception
	// System.out.println(figTr.calculatePerimeter());

	// trFig.printInfo();
	// Figure.printInfo();

	Triangle tr = new Triangle(3, 4, 5);
	System.out.println(tr.getMiSelf().calculatePerimeter());
    }
}
